<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>Healery Macros</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	</head>
	<body>
<p>  There are lots of examples in the Macro Instructions file, of course, but they're buried in documentation some may find intimidating. <br>

<br> 
Here are some more examples and (hopefully) simpler explanations:<br> 
<br>
<br> 
<span class="small_headLeft">Basic typing shortcuts</span><br>
<br> 
<br> 
Put the macro name in double quotes, or the name of the key, like before. Then on the same line, list everything you want it to say. Nothing that isn't in the macro you define will be entered in.  If you want the text you type to be included, put in @text. If you want it to hit return at the end, add "\r". (That's a bit of a change from before.)<br>
<pre>shift-f1"/action waves.\r"
"aa""/action " @text "\r"
"th""/thank " @splayer " " @text "\r"
"sit"   "/action sits down.\r/pose sit\r"</pre>
<p><br> 
@text is whatever you have typed in, other than the macro name itself and a space after it (I think).  @splayer is the name (no spaces or punctuation) of the person you have selected.  So with that third macro, if I select AlthePal and type:</p>
<pre>th for being a nice guy.</pre>

<p>It'll be entered in as:</p>
<pre>/thank AlthePal for being a nice guy.</pre>
<p>First "/thank ", then the selected player's name, then a space, then what I typed after the macro name and space, and finally a return.<br>
<br> 
<span class="small_headLeft">Macros with multiple commands</span><br>
<br> 
There are a couple of kinds of commands.  Typing any amount of text all at once (including things that hold text, like @text and @splayer) is one
command. There are also commands for pause, equip, unequip, move, and random.  (Also fancier ones that I won't get into here.)  If you want a
macro to have more than one command, you have to use curly brackets { } to enclose them all.</p>
<pre>"fight"
{<br>"/action readies for combat.\r"
"/equip axe\r"
pause 2<br>"/equip shield\r"<br>}</pre>

<p>This is just like a whole series of the single-command macros above.  You<br> 
can give multiple-command macros names or keys, and you can list as many<br> 
commands in each as you want.<br>
<br> 
<span class="small_headLeft">Random macros</span><br>
<br>
One of the commands is "random".  It's complicated enough, and common<br> 
enough, that it deserves a section of its own.  Here's a simple example:
<pre>"hi"
{ 
random no-repeat
"Hi there!\r"  
or
"Hello!\r" 
or
"Nice day, isn't it!\r"
or
"/action waves cheerily.\r"   
end random  
}</pre> 
<p>This macro chooses one of the four options and types that text.  The "no-repeat" means that it will never choose the same option twice in a 
  row.  Let's look at a more complicated random example:
  <pre>"nap"  
{  
  random
  "/action lies down to nap.\r/pose lie\r/sleep\r" 
  pause 10
  "/ponder This axe isn't a very comfortable pillow.\r"
  or
  "/unequip right\r"
  "/action meditates peacefully.\r/pose kneel\r/sleep\r"  
  or
  "/action falls asleep on his feet.\r/sleep\r" 
  pause 15
  "/ponder Zzz...*gsnorrrk*\r" 
  end random   
  pause 20
  "Ah, that was a nice nap.\r"   
  }</pre>

  <p>This starts out by randomly choosing one of three naps: lying down, kneeling, or standing up.  Whichever one it chooses, it does all the commands in that chunk, until it gets to the next "or" command.  Then it skips everything up to "end random", and continues on with the rest of the macro, in this case pausing for about 5 seconds (20 frames) and then talking about the nap.<br>
<br> 
<span class="small_headLeft">Replacement macros</span><br> 
<br> 
This is a different kind of macro.  It's meant to expand abbreviations inside whatever you're typing.  Replacement macro names are marked by single quotes instead of double quotes.  They expand as you type, when the macro name (abbreviation) is followed by a space or return.
<pre>'DT'  "Dark Temple"
'OC'  "Orga Camp"
'thx'  "thank you!"</pre> 
<p>With these, I can type
<pre>You helped me in the OC and I hardly know how to thx</pre> 
  <p>and it will come through as  </p>
  <pre>You helped me in the Orga Camp and I hardly know how to thank you!</pre> 
  <p>If you want to type an abbreviation followed by a space or return, but for some reason you *don't* want it to expand out, hold control as you type the space or return.  For example, if you're talking to someone in the fairgrounds, you might want to say:

<pre>You can get the update from the DT Web page.</pre>

<p>To have that come through as "DT" instead of "Dark Temple", hold down<br>
  control as you type the space right after "DT".<br> 
<br> 
  Like the other kind, replacement macros can be random:
  <pre>'bye'
  {   
  random
  "Farewell, "   
  or
  "Bye-bye now, "   
  or
  "See you later, "   
  end random
  } </pre>
   
 <p> Now if I type</p> 
  
  <pre>bye friends!</pre>

  
  <p>I'll get either "Farewell, friends!" or "Bye-bye now, friends!" or "See you later, friends!", chosen randomly.  You can't put a pause, equip, or unequip in a replacement macro. <br>
  <br> 
<span class="small_headLeft">Including files</span><br> 
<br> 
You might want some of your macros to be used with more than one character.  You can put them all in one file, and use that file in each character's own macro file.  The file called "Default" is automatically included in every character's macro file, but you can take it back out if you want.  If the same key or macro name is defined twice, maybe once in a general file and once in this character's file, the one encountered 
*first* will be used, and you'll get a warning when you connect.  You can ignore that error message if it's what you meant to do.  For instance, you might have:
	<pre>
include "Sylvan Words"
include "Default"
</pre>
    <p>If the "Default" file has a general macro for "hi" for most of your 
      characters, and "Sylvan Words" has a different "hi" macro for the three
      Sylvans you play :), this lets the Sylvans say "H'loi" when the rest of
      the gang says "Hello". <br>
<br> 
<span class="small_headLeft">Echoing</span><br> 
  <br> 
      Normally, when a macro is used it appears expanded in your input area,
      instead of having only what you actually typed show up there.  To change 
      that, put this at the top of your macro file:	  </p><pre> set @env.echo false</pre>

      <p>The opposite, of course, is      </p>
      <pre>set @env.echo true</pre>
      <p><br> 
  <span class="small_headLeft">Reference section</span><br>
  <br> 
There are a lot more complicated things in the macros, which you can read 
about in the Macro Instructions.  You can define subroutines, set 
variables, check conditions, make loops, assign macros to clicking, and 
even send yourself a message.  I won't talk about any of those here.  But 
I will list the simple automatic variables and commands I've already 
referred to.<br>
<br>
<strong>Variables</strong><br>

<pre>@text - whatever you typed in, except for the macro name and a space
@textsel - the text you have selected when the macro starts
@my.name - your character's name
@selplayer.name - selected player's name (no spaces or punctuation)
@selplayer.name - selected player's name (with spaces and punctuation)
@my.right_item - name of what you're holding in your right hand
@my.left_item - name of what you're holding in your left hand</pre>

    <p><br>
      <strong>Commands</strong>
    <pre>pause
random   
or   
end random   
set @env.echo false   
set @env.echo true</pre>
<p><br>
  Whew, there you go.  Hope that helps!</p>

		<hr>
		<p>
			This page is an edited version of the file located at <a href="http://www.deltatao.com/clanlord/macros/healery_macros.html">Healery Macros</a>.
			<br>
			All copyrights and rights are owned by <a href="http://www.deltatao.com">Delta Tao Software</a>
		</p>
		<p>
			<a href="http://validator.w3.org/check?uri=referer"><img
				src="http://www.w3.org/Icons/valid-html401-blue"
				alt="Valid HTML 4.01 Transitional" height="31" width="88"></a>
		</p>
</body>
</html>